/* Used to make sure files are only brought in once */
#ifndef SCENE_H
#define SCENE_H

#include "IDrawable.h"
#include "Balls.h"
#include "Vec3f.h"
#include "Stick.h"
#include "Light.h"
#include "Common.h"


class Pocket : public IDrawableObject
{
public:
   Pocket(Vec3f);
   void draw(bool) = 0;
   bool hit(Ball* ball);
   bool near(Ball* ball);
   virtual double getRadius() = 0;
protected:
   Vec3f origin;
};

class SidePocket : public Pocket
{
public:
   SidePocket(Vec3f);
   void draw(bool);
   double getRadius() { return Config::getSidePocketRadius();}
};

class CornerPocket : public Pocket
{
public:
   CornerPocket(Vec3f);
   void draw(bool);
   double getRadius() { return Config::getCornerPocketRadius();}
};

class Room : public IDrawableObject
{
public:
   Room();
   void draw(bool);
};

class TableSides : public IDrawableObject
{
public:
   TableSides();
   void draw(bool);
};

class TableTop : public IDrawableObject
{
public:
   TableTop();
   void draw(bool);
};

class Table : public IDrawable
{
public:
   Table();
   ~Table();
   void draw(bool);
   void drawShadow(Vec3f pos, Vec3f dif, int index);
   vector<Pocket*> getPockets();
protected:
   TableTop* tableTop;
   TableSides* tableSides;
   vector<Pocket*> pockets;
};

class Scene {
public:
   Scene();
   ~Scene();
   void setup();
   void draw(bool, bool);
   CueBall* getCueBall();
   Ball** getPlayingBalls();
   Table* getTable();   
   Stick* getStick();
   void setAngle(double);
   double getAngle();
   void changeAngleBy(double);
protected:
   CueBall* cueBall;
   Ball* playingBalls[15];
   Stick* stick;
   Table* table;
   Room* room;   
   Vec3f center;
   double angle;
   Light* light;
   Light* light2;
   Light* light3;
};

#endif
